package br.com.notepadeti.form;

import java.util.ResourceBundle;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

public class NotaForm extends ActionForm {

	private static final long serialVersionUID = 1L;

	private String descricao;
	private String senha;
	private String url;

	@Override
	public ActionErrors validate(ActionMapping mapping,
			HttpServletRequest request) {

		ResourceBundle messageResource = ResourceBundle
				.getBundle("br.com.notepadeti.resource.MessageResource");

		ActionErrors actionErrors = new ActionErrors();

		//if (descricao == null || descricao.trim().equals("")) {
		//	actionErrors.add("nota_vazia", new ActionError(messageResource.getString("error.nota_vazia")));
		//}
		// try {
		// if(password == null || password.trim().equals("")) {
		// actionErrors.add("password", new ActionMessage("error.password"));
		// }
		// }catch(Exception e) {
		// e.printStackTrace();
		// }
		return actionErrors;
	}

	public String getDescricao() {
		return descricao;
	}

	public void setDescricao(String descricao) {
		this.descricao = descricao;
	}

	public String getSenha() {
		return senha;
	}

	public void setSenha(String senha) {
		this.senha = senha;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

}
